home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-18 | 5.3 KB | 145 lines | [TEXT/PJMM] |
- {****************************************************}
- {}
- { SATTCLIntf.p }
- {}
- { Interface file for the classes by which the THINK Class Library can be used }
- { with the Sprite Animation Toolkit. }
- {}
- { The interface is deliberately kept minimal, making TCL work with SAT, rather }
- { than the other way around. Commands to SAT are activated using the usual }
- { SAT* type commands. Sprites are treated in the same way as for other SAT }
- { projects. }
- {}
- { SAT-TCL }
- { Copyright © 1995 by Patrick C Hew. All rights reserved. }
- { Use of this package follows the same restrictions as for SAT. }
- {}
- { Sprite Animation Toolkit }
- { Copyright © 1992-1994 by Ingemar Ragnemalm. All rights reserved. }
- { See documentation for licensing details and the restrictions on use. }
- {}
- { THINK Class Library }
- { Copyright © 1989 by Symantec Corporation. All rights reserved. }
- {}
- { Revision History: }
- {}
- { Version: 1.00 for TCL 1.1.2 and SAT 2.3b4 }
- { Date: 20 December 1995 }
- { Author: Patrick C Hew <phew@ucc.gu.uwa.edu.au> }
- { Notes: Initial release - CSATDirector and CSATPane . }
- {}
- {****************************************************}
-
-
- unit SATTCLIntf;
-
- interface
-
- uses
- TCL, SAT;
-
-
- {****************************************************}
- {}
- { CSATDirector }
- {}
- { Director class for use with the Sprite Animation Toolkit. This class isolates a }
- { number of methods which should be overridden for particular applications. }
- {}
- { This object can be used as a model for overriding CDocument or some other }
- { director, should that be desired. }
- {}
- { Important: Only one instance of this class should exist, namely the director }
- { which supervises the window containing CSATPane. Remember that SAT is }
- { designed for a single rectangle of animation in a single window. }
- {}
- {****************************************************}
-
- type
- CSATDirector = object(CDirector)
-
- { This variable should point to the single instance of CSATPane. }
- itsSATPane: CSATPane;
-
- { Initialization. }
- procedure ISATDirector (aSupervisor: CApplication);
-
- { Calls SATSoundShutup. This might be a good place to dispose of the sprites. }
- procedure Free;
- override;
-
- { BuildWindow should build the window, and create the single instance }
- { of CSATPane. You must assign itsSATPane to point to it. }
- procedure BuildWindow;
-
- { You can call SAT to set up your sprites and sounds in these methods. }
- { SAT must already be initialized before you can do so. In other words, }
- { you should probably call BuildWindow first. }
- procedure SetUpSprites;
-
- procedure SetUpSounds;
-
- { SAT is designed for writing games, and envisages having SATRun }
- { being called repeatedly within a dedicated "game loop". The following }
- { three methods are in preparation for this model. }
- { Another option is to put SATRun in the director's Dawdle method, }
- { using the normal event loop, but this is very slow. }
-
- { Do tasks prior to the game loop. The default method fools itsSATPane }
- { into refreshing itself, so that SAT can modify the contents whilst }
- { knowing that the ports are set correctly. }
- procedure PrepareForPlaying;
-
- { This should be the game loop. }
- procedure DoPlay;
-
- { Clean up after playing. }
- procedure FinishPlaying;
-
- end;
-
-
- {****************************************************}
- {}
- { CSATPane }
- {}
- { Panorama class for use with the Sprite Animation Toolkit. This basically call }
- { SATCustomInit to set up the animation area, and implements it in a panorama. }
- {}
- { The bounds of the panorama are the rectangle specified to SAT. The other }
- { parameters are as per SAT. We ignore the options for centering the drawing }
- { area and filling the screen, since these are handled by the window class and }
- { the decorator class (if used). }
- {}
- { Important: Only one instance of this class should exist. This is where SAT }
- { thinks that its drawing area is. }
- {}
- {****************************************************}
-
- { Synonyms for some of the parameters. }
-
- const
- kUseMenuBar = TRUE;
- kNoUseMenuBar = FALSE;
- kDither4Bit = TRUE;
- kNoDither4Bit = FALSE;
- kBeSmart = TRUE;
- kNoBeSmart = FALSE;
-
- type
- CSATPane = object(CPanorama)
-
- procedure ISATPane (anEnclosure: CView; aSupervisor: CBureaucrat; aWidth, aHeight, aHEncl, aVEncl: Integer; aHSizing, aVSizing: SizingOption; aPICTColor, aPICTBW: Integer; aSATRect: Rect; aUseMenuBar, aDither4bit, aBeSmart: Boolean);
-
- procedure Draw (var area: Rect);
- override;
-
- { Sets up the pane so that SAT can do what it likes without TCL }
- { doing strange things. }
- procedure PrepareForSATRun;
-
- end;
-
- implementation
-
- end. { SATTCLIntf }